home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / MOVIES / SHARED.DIR / 01005_Script_all purpose utility stuff < prev    next >
Text File  |  1995-11-21  |  5KB  |  163 lines

  1. on setEditText
  2.   repeat with i = 2000 to 3002
  3.     if the castType of cast i = #Text then
  4.       --set the editableText of 
  5.     end if
  6.     
  7.   end repeat
  8.   
  9. end
  10.  
  11. on tweaker
  12.   repeat with i = 1 to 256
  13.     go frame i
  14.     setTopLeft 5,0,0
  15.     settopleft 6,0,27
  16.     setTopLeft 7,0,452
  17.     setTopLeft 8,4,58
  18.   end repeat
  19. end tweaker
  20.  
  21. on setTopLeft theSprite, theH,theV
  22.   put the castNum of sprite theSprite into cN
  23.   if cN = 0 then exit
  24.   put the rect of cast cN into oldRect
  25.   --puppetSprite theSprite,true
  26.   spriteBox theSprite, (the left of oldRect)+theH, (the top of oldRect)+theV,(the right of oldRect)+theH, (the bottom of oldRect)+theV
  27.   updateStage
  28.   --puppetSprite theSprite,false
  29. end setTopLeft
  30.  
  31. on getmovieNames theFirstCharMustBe
  32.   set movieList to []
  33.   repeat with i = 1 to 1023
  34.     set bob to getNthFileNameInFolder(the pathname,i)
  35.     if char 1 of bob <> theFirstCharMustBe then next repeat
  36.     if bob = "Shared.Dir" then next repeat
  37.     if char(length(bob)-3) to length(bob) of bob <> ".DIR" then next repeat
  38.     if char 1 of bob = "_" then next repeat
  39.     if bob = "" then exit repeat
  40.     add movieList,bob
  41.   end repeat
  42.   return movieList
  43. end
  44.  
  45. on usedChannels
  46.   global it
  47.   set the updateMovieEnabled to true
  48.   put it into theMovies
  49.   set usedChannels to ""
  50.   repeat with i = 1 to count(theMovies)
  51.     go frame 1 of movie string(getAt(theMovies,i))
  52.     repeat with j = 1 to 500
  53.       go frame j
  54.       repeat with k = 1 to 48
  55.         if the castNum of sprite k <> 0 then
  56.           put integer(item k of usedChannels) into temp
  57.           put temp+1 into temp
  58.           put string(temp) into item k of usedChannels
  59.         end if
  60.       end repeat
  61.     end repeat
  62.   end repeat
  63.   put usedChannels
  64.   set mylist to list(usedChannels)
  65.   repeat with j = 1 to count(usedChannels)
  66.     put string(j)&": "&string(getat(mylist,j))
  67.   end repeat
  68. end usedChannels
  69.  
  70. on createObjectList
  71.   global myMovieList,objectList,myLabelList, thisLabelName
  72.   put getMovieNames("O") into myMovieList
  73.   put "" into thisLabelName
  74.   set myLabelList to [:]
  75.   repeat with i = 1 to count(myMovieList)
  76.     put getAt(myMovieList,i) into thisMovie
  77.     go movie thisMovie
  78.     put linesToList(the labelList) into thisMoviesLabels
  79.     repeat with j = 1 to count(thisMoviesLabels)
  80.       put getAt(thisMoviesLabels,j) into thisLabelName
  81.       go frame label(thisLabelName)+1
  82.       put the castNum of sprite 8 into textCast
  83.       if textCast = 0 then next repeat
  84.       put the castNum of sprite 1 into pictCast
  85.       if pictCast <> 0 then
  86.         put the name of cast pictCast into pictCast
  87.         put the name of cast textCast into textCast
  88.         if prefix(pictCast) = thisLabelName then
  89.           do "addProp myLabelList, #"&(thisLabelName)&", list(textCast,the movieName)"
  90.         end if
  91.       end if
  92.     end repeat
  93.   end repeat
  94.   put myLabelList into field "O.DIR"
  95. end createObjectList
  96.  
  97. on prefix what
  98.   return char 1 to offset(".",what)-1 of what
  99. end prefix
  100.  
  101. on linesToList fromWhat
  102.   set newList to []
  103.   repeat with i = 1 to (the number of lines in fromWhat)
  104.     put word 1 of line i of fromWhat into it
  105.     if it <> "" then append newList,it
  106.   end repeat
  107.   return newList
  108. end linesToList
  109.  
  110. on paletteTally
  111.   global movieList, paletteCount
  112.   set movieList to getmovieNames()
  113.   set paletteCount to [:]
  114.   repeat with i = 1 to count(movieList)
  115.     set paletteCounter to 0
  116.     put getAt(movieList,i) into it
  117.     go movie it
  118.     repeat with j = 1 to (the number of castmembers)
  119.       if the castType of cast j = #palette then
  120.         set paletteCounter to (paletteCounter+1)
  121.       end if  
  122.     end repeat
  123.     addProp paletteCount,it,paletteCounter
  124.   end repeat
  125.   printPaletteTallyResults
  126. end paletteTally
  127.  
  128. on printPaletteTallyResults
  129.   global paletteCount
  130.   put empty into it
  131.   repeat with i = 1 to count(paletteCount)
  132.     set it to it&return& getPropAt(paletteCount,i)&tab&getaProp(paletteCount, getPropAt(paletteCount,i))
  133.   end repeat
  134.   put it
  135. end printPaletteTallyResults
  136.  
  137. on likeObjects
  138.   global hitList
  139.   set hitList to [:]
  140.   set oList to [:]
  141.   set it to ""
  142.   set lastLabel to ""
  143.   set oList to value(field "O.DIR")
  144.   --sort oList
  145.   repeat with i = 1 to count(oList)
  146.     put ","&(getPropAt(oList,i)) after it
  147.     --    if likeness(it,lastLabel) < 4 then
  148.     --      put it into lastLabel
  149.     --      next repeat
  150.     --    else
  151.     --      setaProp hitList, it, getaprop(hitList,it)+1
  152.     --    end if
  153.   end repeat
  154.   put it
  155. end likeObjects
  156.  
  157. on likeness string1,string2
  158.   put 0 into likeness
  159.   repeat with i = 1 to max(length(string1),length(string2))
  160.     put likeness+integer((char i of string1)=(char i of string2)) into likeness
  161.   end repeat
  162.   return likeness
  163. end likeness